package com.example.qxfw.qxzs.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.qx.SpecialSrvStation;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Mapper;


import java.util.List;

@Mapper
@DS("service")
public interface SpecialSrvStationMapper extends BaseMapper<SpecialSrvStation> {

    @Select("select distinct StationName, Stationid, Longitude, Latitude, flag " +
            "from special_srv_station " +
            "where StationID is not null And flag like '%指数%' " +
            "order by stationid")
    List<SpecialSrvStation> selectList1();

    @Select("select StationName " +
            "from special_srv_station " +
            "where flag like '%指数%'")
    List<String> selectStationName();

    @Select("select distinct flag " +
            "from special_srv_station " +
            "where flag like '%指数%'")
    List<String> selectStationFlag();

    @Select("select * " +
            "from special_srv_station " +
            "where flag like  '%${flag}%' ")
    List<SpecialSrvStation> selectList2(String flag);

    @Select("select distinct stationId " +
            "from special_srv_station " +
            "where stationname = '${stationName}' ")
    List<String> selectStationIdByName(String stationName);

    @Select("select distinct stationId,stationname " +
            "from special_srv_station " +
            "where StationID like '5%'and City like '${city}%' ")
    List<SpecialSrvStation> selectList3(String city);

    @Select("select stationId,stationname " +
            "from special_srv_station " +
            "where StationId=#{stationId} ")
    List<SpecialSrvStation> selectList4(String stationId);

    @Select("select StationId, StationName " +
            "from special_srv_station " +
            "where StationID in (${stationId}) and flag='${flag}' and City like '${city}%'")
    List<SpecialSrvStation> selectList5(String stationId,String flag,String city);


}
